const mongoose = require('mongoose')
const dotenv = require("dotenv");
const app = require("./app");


dotenv.config({ path: "./config.env" });
// console.log(process.env);
const DB  = process.env.DATABASE
mongoose.connect(DB,{
  useNewUrlParser:true,
  useCreateIndex:true,
  useFindAndModify:false
}).then(con=>{
  // console.log(con.connections)
  console.log('DB connect successful')
})



const port = process.env.PORT || 3000;
app.listen(port, () => {
  console.log("Success");
});
